<!--
 * @Author: zengwj
 * @Date: 2022-06-27 15:30:21
 * @LastEditors: zengwj
 * @LastEditTime: 2022-06-27 15:56:05
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    /**
     * @description: 
     * @param {*} L 对象
     * @param {*} R 构造函数
     * @return {*}
     */
    
    function myInstance(L, R) {
      if (Object(L) !== L) return false
      let link = L.__proto__
      while (link !== null) {
        if (link === R.prototype) return true
        link = link.__proto__
      }
      return false
    }
    function Car(make, model, year) {
      this.make = make;
      this.model = model;
      this.year = year;
    }
    const auto = new Car('Honda', 'Accord', 1998);
    console.log(myInstance(auto, Car))
  </script>
</body>

</html>